Accept() + saving views

Hello,

Is it possible to save the following dxl script as a view so that I can use it within a RPE template?

{code}

//<
/*
Generate Inventory of Softdeleted Requirements
*/
pragma runLim, 0
noError

Module m = current
Object o = null

showDeletedObjects(true)

filtering off
sorting off

/************************************
    hasLinks
*************************************/
bool hasLinks(Object& o) {
    Link l = null
    for l in all(o->"*") do {
        if(name(module(l)) == "child2parent"    ||
           name(module(l)) == "parent2child"    ||
           name(module(l)) == "SDM"                ||
           name(module(l)) == "See also") continue
        return(true)
    }
    return(false)
}

for o in entire m do {
    if(hasLinks(o) && isDeleted(o)) {accept o}
    else {reject o}
}

filtering on
refresh current

{code}

 


EHcnck - Wed May 01 23:40:03 EDT 2013

Re: Accept() + saving views
Tony_Goodman - Thu May 02 08:22:52 EDT 2013

The results of accept() and reject() cannot be saved in a view.

 

I would suggest creating a DXL attribute that contains some value determined by the same rules you use for accept and reject.

The DXL attribute can then be used to apply a filter which can be saved in a view.

 

EDIT: Having looked at your code I see that you are displaying soft deleted objects, so DXL attributes will not work.

You will have to use a layout DXL column instead which can also be used to create a filter.

 

Re: Accept() + saving views
llandale - Thu May 02 11:31:01 EDT 2013

Tony_Goodman - Thu May 02 08:22:52 EDT 2013

The results of accept() and reject() cannot be saved in a view.

 

I would suggest creating a DXL attribute that contains some value determined by the same rules you use for accept and reject.

The DXL attribute can then be used to apply a filter which can be saved in a view.

 

EDIT: Having looked at your code I see that you are displaying soft deleted objects, so DXL attributes will not work.

You will have to use a layout DXL column instead which can also be used to create a filter.

 

I emphasize that attr-DXL and Layout cannot do this: if (whatever) then reject(obj) else accept(obj)

v9200 and v9201 had a bug where attr-DXL could not set values of deleted objects.  It was fixed in v9202; so your attr-DXL suggestion will work, except for those versions.

All my Attr-DXL has this:

  • if (null obj or null attrDXLName)    then halt
  •                    // Bug in these versions:
  • if (isDeleted(obj)     and
  •     length(doorsInfo(infoVersion)) >=7   and
  •     (((doorsInfo(infoVersion))[0:6] == "9.2.0.1") or
  •     (((doorsInfo(infoVersion))[0:6] == "9.2.0.0"))))  then halt

I don't think you can filter on a layout column.

-Louie
 

-Louie

Re: Accept() + saving views
Pekka_Makinen - Fri May 03 03:14:01 EDT 2013

llandale - Thu May 02 11:31:01 EDT 2013

I emphasize that attr-DXL and Layout cannot do this: if (whatever) then reject(obj) else accept(obj)

v9200 and v9201 had a bug where attr-DXL could not set values of deleted objects.  It was fixed in v9202; so your attr-DXL suggestion will work, except for those versions.

All my Attr-DXL has this:

  • if (null obj or null attrDXLName)    then halt
  •                    // Bug in these versions:
  • if (isDeleted(obj)     and
  •     length(doorsInfo(infoVersion)) >=7   and
  •     (((doorsInfo(infoVersion))[0:6] == "9.2.0.1") or
  •     (((doorsInfo(infoVersion))[0:6] == "9.2.0.0"))))  then halt

I don't think you can filter on a layout column.

-Louie
 

-Louie

Filtering on Layout DXL column is possible - it is the "Columns" filtering in DOORS GUI or in DXL "FIlter column".

Re: Accept() + saving views
llandale - Fri May 03 11:08:48 EDT 2013

Pekka_Makinen - Fri May 03 03:14:01 EDT 2013

Filtering on Layout DXL column is possible - it is the "Columns" filtering in DOORS GUI or in DXL "FIlter column".

Golly.  After all these years maybe I should start using the GUI...

Re: Accept() + saving views
nm3210 - Fri May 03 14:13:52 EDT 2013

llandale - Fri May 03 11:08:48 EDT 2013

Golly.  After all these years maybe I should start using the GUI...

Seems a lot of it is just made in DXL anyway....

Re: Accept() + saving views
llandale - Fri May 03 14:21:06 EDT 2013

nm3210 - Fri May 03 14:13:52 EDT 2013

Seems a lot of it is just made in DXL anyway....

More than "a lot".  I hear tell the "Module" and "Explorer" are mostly non-DXL; but just about everthing else is; including the buttons on those windows.

Re: Accept() + saving views
Tony_Goodman - Tue May 07 04:49:37 EDT 2013

llandale - Fri May 03 14:21:06 EDT 2013

More than "a lot".  I hear tell the "Module" and "Explorer" are mostly non-DXL; but just about everthing else is; including the buttons on those windows.

The Formal Module window is indeed mostly non-DXL except for the menus.

The Database Explorer Window is 100% DXL.

All dialogs are 100% DXL, except for some rarely seen error messages.